The adaptive control of social behaviors, such as aggression and reproduction, is a critical function of the nervous system. In the past decade, new methods for genetically targeted functional manipulation and imaging of neural activity have proven phenomenally fruitful in identifying neural subpopulations that play a role in expression of social behaviors. But our understanding of how these neural populations work together in a behaving animal remains highly fractured. In the proposed work, we develop a computational approach to integrate neural imaging data from multiple genetically targeted neural populations and construct a circuit model of social behavior control. A significant challenge in studying social behavior is its high variability and complexity, features that defy traditional trial-averaging-based analyses of neural activity. To address this challenge, we will leverage our recently developed automated tracking system to build a quantitative and detailed model of social behaviors and sensory processing in pairs of freely interacting mice. This behavior model will provide the basis for a thorough statistical analysis of neural dynamics within and between a collection of four subcortical nuclei, which together span three putative layers of processing, the first just past the sensory periphery and the last just upstream of premotor populations in the periaqueductal gray. This analysis will include 1) predicting animals' future behavior from joint neural and behavioral models, 2) characterizing behavior tuning of individual neurons in each nucleus with a linear-nonlinear model, and 3) fitting a network model to imaging data from multiple nuclei, and testing predicted connectivity from this model with a novel optogenetic perturbation system. Finally, we will build on these analyses to address the flexibility of behavior control by network models of subcortical nuclei. In the K99 phase, this research plan will allow me to develop advanced skills in the use of deep learning and recurrent neural networks for data analysis: skills that will be increasingly important as more labs start to study complex behaviors and meso-scale neural circuits. The strong computational environment at Caltech, including the labs of Pietro Perona, Markus Meister, and Doris Tsao, makes it an ideal place to develop my technical training, while the strength of the Anderson lab's experimental program provides a unique chance to collaborate closely with experimentalists in testing and refining models. Additional training in data presentation, teaching, grant-writing, and student mentorship will allow me to transition to an independent position. In the independent R00 phase, I will use these skills and the objectives of my remaining Aims to build a laboratory focused on the study of flexibility and behavioral adaptability in meso-scale neural circuits.